package com.xls.box2023.entity;

import android.text.TextUtils;

import com.xls.box2023.BoxAppLication;

import java.io.File;
import java.io.Serializable;

import static android.os.Environment.DIRECTORY_DOWNLOADS;

public class YouXiEntity  implements Serializable {

    /**
     * appId : 0
     * appName : string
     * appUserId : 0
     * content : string
     * createTime : 2023-08-22T06:52:21.984Z
     * createUserId : 0
     * devideRate : 0
     * downCoins : 0
     * downloadUrl : string
     * exchangeCount : 0
     * exchangeMax : 0
     * id : 0
     * picture : string
     * refferScore : 0
     * refferScoreTotal : 0
     * score : 0
     * scoreMax : 0
     * scoreTotal : 0
     * status : 0
     * tenantCode : string
     * tenantId : 0
     * updateTime : 2023-08-22T06:52:21.984Z

     */

    private Long appId;
    private String appName;
    private long appUserId;
    private String content;
    private String createTime;
    private long createUserId;
    private long devideRate;
    private float downCoins;
    private String url;
    private long exchangeCount;
    private long exchangeMax;
    private long id;
    private String picture;
    private String refferScore;
    private String refferScoreTotal;
    private String score;
    private String scoreMax;
    private String scoreTotal;
    private long status;
    private String tenantCode;
    private long tenantId;
    private String updateTime;

    private int downStatus;

    private int download_pro;

    private String appFileName;

    private String appSignName;

    private String packageName;

    private int position;

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public String getPackageName() {
        return packageName;
    }

    public String getJksName() {
        return appSignName;
    }

    public void setJksName(String jksName) {
        this.appSignName = jksName;
    }

    public String getFileName() {
        return appFileName;
    }

    public void setDownload_pro(int download_pro) {
        this.download_pro = download_pro;
    }

    public int getDownload_pro() {
        return download_pro;
    }

    private String tenantName;

    private String fileMd5;

    private String md5;

    private String downLoadState="";

    public String getDownLoadState() {
        return downLoadState;
    }

    public void setDownLoadState(String downLoadState) {
        this.downLoadState = downLoadState;
    }

    public String getMd5() {
        if (TextUtils.isEmpty(fileMd5))return md5;
        return fileMd5;
    }

    public void setMd5(String md5) {
        this.fileMd5 = md5;
        this.md5=md5;
    }

    public void setFileSize(long fileSize) {
        this.fileSize = fileSize;
    }

    private long fileSize;

    public long getFileSize() {
        return fileSize;
    }

    //    下载状态
    private String downState= "";

    public String getDownState() {
        return downState;
    }

    public void setDownState(String downState) {
        this.downState = downState;
    }

    public String getTenantName() {
        return tenantName;
    }

    public int getDownStatus() {
        return downStatus;
    }

    public Long getAppId() {
        return appId;
    }

    public void setAppId(Long appId) {
        this.appId = appId;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public long getAppUserId() {
        return appUserId;
    }

    public void setAppUserId(long appUserId) {
        this.appUserId = appUserId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(long createUserId) {
        this.createUserId = createUserId;
    }

    public long getDevideRate() {
        return devideRate;
    }

    public void setDevideRate(long devideRate) {
        this.devideRate = devideRate;
    }

    public float getDownCoins() {
        return downCoins;
    }

    public void setDownCoins(long downCoins) {
        this.downCoins = downCoins;
    }

    public String getDownloadUrl() {
        return url;
    }

    public void setDownloadUrl(String downloadUrl) {
        this.url = downloadUrl;
    }

    public long getExchangeCount() {
        return exchangeCount;
    }

    public void setExchangeCount(long exchangeCount) {
        this.exchangeCount = exchangeCount;
    }

    public long getExchangeMax() {
        return exchangeMax;
    }

    public void setExchangeMax(long exchangeMax) {
        this.exchangeMax = exchangeMax;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public String getRefferScore() {
        return refferScore;
    }

    public void setRefferScore(String refferScore) {
        this.refferScore = refferScore;
    }

    public String getRefferScoreTotal() {
        return refferScoreTotal;
    }

    public void setRefferScoreTotal(String refferScoreTotal) {
        this.refferScoreTotal = refferScoreTotal;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    public String getScoreMax() {
        return scoreMax;
    }

    public void setScoreMax(String scoreMax) {
        this.scoreMax = scoreMax;
    }

    public String getScoreTotal() {
        return scoreTotal;
    }

    public void setScoreTotal(String scoreTotal) {
        this.scoreTotal = scoreTotal;
    }

    public long getStatus() {
        return status;
    }

    public void setStatus(long status) {
        this.status = status;
    }

    public String getTenantCode() {
        return tenantCode;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    public long getTenantId() {
        return tenantId;
    }

    public void setTenantId(long tenantId) {
        this.tenantId = tenantId;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getFilePath() {
        return  BoxAppLication.getBaseApplication().getAppManager().currentActivity().getExternalFilesDir(DIRECTORY_DOWNLOADS)+ File.separator+appName+".apk";
    }
}
